<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of NodeModel
 *
 * @author John
 */
namespace Admin\Model;
use Think\Model\RelationModel;

class NodeModel  extends RelationModel {
    public $_validate = array(
        array('name','require','字段名称必填'),
        array('title','require','权限名称必填'),
    );
    
    public $_auto = array(
        array('status','1'),
    );
    
    protected $_link = array(
        'Role' => array(
            'mapping_type'  => self::MANY_TO_MANY,
            'class_name'            => 'Role',
            'foreign_key'           => 'node_id',
            'relation_foreign_key'  => 'role_id',
            'relation_table'        => 'zh_access',
        ),
    );
}
